//
//  ONObjectAlert.m
//  Volatix
//
//  Created by Familly on 6/27/14.
//  Copyright (c) 2014 Familly. All rights reserved.
//

#import "ONObjectAlert.h"
@interface ONObjectAlert ()

- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;

@end
@implementation ONObjectAlert

- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init];
    
    self.symbleName = [aDecoder decodeObjectForKey:@"SYMBLE_NAME"];
    self.Type = [aDecoder decodeIntegerForKey:@"TYPE"];
    self.IsAutoAdd= [aDecoder decodeBoolForKey:@"IS_AUTO_ADD"];
    return self;
}

- (void)encodeWithCoder:(NSCoder *)aCoder
{
    
    [aCoder encodeObject:self.symbleName forKey:@"SYMBLE_NAME" ];
    [aCoder encodeInteger:self.Type forKey:@"TYPE"];
    [aCoder encodeBool:self.IsAutoAdd forKey:@"IS_AUTO_ADD"];
    
}

- (id)copyWithZone:(NSZone *)zone
{
    ONObjectAlert *copy = [[ONObjectAlert alloc] init];
    
    if (copy) {
        
        copy.symbleName =[self.symbleName copyWithZone:zone];
        copy.Type =self.Type;
        copy.IsAutoAdd =self.IsAutoAdd;
    }
    
    return copy;
}






- (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict
{
    id object = [dict objectForKey:aKey];
    return [object isEqual:[NSNull null]] ? nil : object;
}

@end
